package co.edu.uniandes.visual_analytics.gui;

import java.awt.Color;
import java.awt.Font;

import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.LayoutStyle.ComponentPlacement;

/**
 * Draws a lot of circles in the screen. If the circle intersect another then is
 * painted in a diferent color.
 */
public class PanelDatos extends JPanel {

	private JLabel lblNombrePelicula;
	private JLabel lblTotalGross;
	private JLabel labelOpenGross;
	private StarRater labelRating;

	public PanelDatos() {

		lblNombrePelicula = new JLabel("Drop Movie");
		lblNombrePelicula.setForeground(Color.WHITE);
		lblNombrePelicula.setFont(new Font("Verdana", Font.PLAIN, 20));

		lblTotalGross = new JLabel("Drop Movie");
		lblTotalGross.setForeground(Color.WHITE);
		lblTotalGross.setFont(new Font("Verdana", Font.PLAIN, 20));

		JLabel lblMovieName = new JLabel("Movie name:");
		lblMovieName.setForeground(new Color(203, 79, 30));
		lblMovieName.setFont(new Font("Verdana", Font.PLAIN, 20));

		JLabel lblTotalGross_1 = new JLabel("Total Gross:");
		lblTotalGross_1.setForeground(new Color(203, 79, 30));
		lblTotalGross_1.setFont(new Font("Verdana", Font.PLAIN, 20));

		JLabel lblOpenGross = new JLabel("Open Gross:");
		lblOpenGross.setForeground(new Color(203, 79, 30));
		lblOpenGross.setFont(new Font("Verdana", Font.PLAIN, 20));

		labelOpenGross = new JLabel("Drop Movie");
		labelOpenGross.setForeground(Color.WHITE);
		labelOpenGross.setFont(new Font("Verdana", Font.PLAIN, 20));

		JLabel lblRating = new JLabel("Rating:");
		lblRating.setForeground(new Color(203, 79, 30));
		lblRating.setFont(new Font("Verdana", Font.PLAIN, 20));

		labelRating = new StarRater(10);
		labelRating.setForeground(Color.WHITE);
		labelRating.setFont(new Font("Verdana", Font.PLAIN, 20));
		GroupLayout groupLayout = new GroupLayout(this);
		groupLayout.setHorizontalGroup(
			groupLayout.createParallelGroup(Alignment.TRAILING)
				.addGroup(groupLayout.createSequentialGroup()
					.addContainerGap()
					.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
						.addComponent(lblMovieName, GroupLayout.PREFERRED_SIZE, 137, GroupLayout.PREFERRED_SIZE)
						.addComponent(lblTotalGross_1))
					.addGap(18)
					.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
						.addComponent(lblNombrePelicula, GroupLayout.PREFERRED_SIZE, 137, GroupLayout.PREFERRED_SIZE)
						.addComponent(lblTotalGross))
					.addGap(48)
					.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
						.addComponent(lblOpenGross, Alignment.TRAILING, GroupLayout.PREFERRED_SIZE, 137, GroupLayout.PREFERRED_SIZE)
						.addComponent(lblRating, Alignment.TRAILING, GroupLayout.PREFERRED_SIZE, 137, GroupLayout.PREFERRED_SIZE))
					.addPreferredGap(ComponentPlacement.RELATED)
					.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
						.addComponent(labelOpenGross, GroupLayout.PREFERRED_SIZE, 137, GroupLayout.PREFERRED_SIZE)
						.addComponent(labelRating, GroupLayout.PREFERRED_SIZE, 168, GroupLayout.PREFERRED_SIZE))
					.addGap(217))
		);
		groupLayout.setVerticalGroup(
			groupLayout.createParallelGroup(Alignment.LEADING)
				.addGroup(groupLayout.createSequentialGroup()
					.addContainerGap()
					.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
						.addComponent(lblMovieName, GroupLayout.PREFERRED_SIZE, 26, GroupLayout.PREFERRED_SIZE)
						.addComponent(lblNombrePelicula)
						.addComponent(labelOpenGross, GroupLayout.PREFERRED_SIZE, 26, GroupLayout.PREFERRED_SIZE)
						.addComponent(lblOpenGross, GroupLayout.PREFERRED_SIZE, 26, GroupLayout.PREFERRED_SIZE))
					.addPreferredGap(ComponentPlacement.UNRELATED)
					.addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
						.addComponent(lblRating, GroupLayout.PREFERRED_SIZE, 26, GroupLayout.PREFERRED_SIZE)
						.addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
							.addComponent(lblTotalGross_1, GroupLayout.PREFERRED_SIZE, 26, GroupLayout.PREFERRED_SIZE)
							.addComponent(lblTotalGross))
						.addComponent(labelRating, GroupLayout.PREFERRED_SIZE, 26, GroupLayout.PREFERRED_SIZE))
					.addContainerGap(19, Short.MAX_VALUE))
		);
		setLayout(groupLayout);
	}

	public JLabel getLblNombrePelicula() {
		return lblNombrePelicula;
	}

	public void setLblNombrePelicula(JLabel lblNombrePelicula) {
		this.lblNombrePelicula = lblNombrePelicula;
	}

	public JLabel getLblTotalGross() {
		return lblTotalGross;
	}

	public void setLblTotalGross(JLabel lblTotalGross) {
		this.lblTotalGross = lblTotalGross;
	}

	public JLabel getLblOpenGross() {
		return labelOpenGross;
	}

	public void setLblOpenGross(JLabel lblOpenGross) {
		this.labelOpenGross = lblOpenGross;
	}

	public StarRater getLblRating() {
		return labelRating;
	}

	public void setLblRating(StarRater lblRating) {
		this.labelRating = lblRating;
	}

}
